Skip to content

Conversation

@lightspark-copybara
Copy link

Auto-synced grid API schemas from webdev.

These schemas are generated from VASP adapter field definitions in sparkcore.

Synced directories:

  • common/ — per-currency account info and beneficiary schemas
  • external_accounts/ — per-currency external account schemas (reference common/)

Please review the changes before merging.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 11, 2026

Greptile Overview

Greptile Summary

This PR auto-syncs the OpenAPI schema definitions for per-currency common/* (account info + beneficiary) and external_accounts/* (account info) types from the upstream “webdev/sparkcore” source. The changes are purely YAML schema updates/expansions and primarily affect how API clients validate and generate types for external account and beneficiary payloads (not runtime code).

Confidence Score: 2/5

  • Not safe to merge until discriminator/accountType consistency is restored for affected schemas.
  • The PR removes accountType enums from multiple common account-info schemas while ExternalAccountInfoOneOf still discriminates on accountType, and also introduces conflicting discriminator values for the same conceptual account types (e.g., CLABE vs CLABE_ACCOUNT). These are schema-level breaking changes that will impact validation and client codegen.
  • openapi/components/schemas/common/GbpAccountInfo.yaml; openapi/components/schemas/common/SgdAccountInfo.yaml; openapi/components/schemas/common/PhpAccountInfo.yaml; openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml

Important Files Changed

Filename Overview
openapi/components/schemas/common/GbpAccountInfo.yaml Removes accountType enum and loosens sort code/account number validation (drops pattern/length/examples), which can break discriminator-based schema selection and allows invalid GBP routing data.
openapi/components/schemas/common/SgdAccountInfo.yaml Schema update appears to remove accountType and SWIFT/BIC validation details (per diff review); likely breaks discriminator selection and allows invalid routing identifiers for SGD accounts.
openapi/components/schemas/common/PhpAccountInfo.yaml Schema update appears to remove accountType (per diff review), which can break discriminator-based selection for PHP account variants.
openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml Discriminator mapping update introduces duplicate/competing keys (e.g., CLABE vs CLABE_ACCOUNT), risking ambiguous validation/codegen depending on what accountType values clients send.
openapi/components/schemas/common/BrlAccountInfo.yaml Auto-synced BRL account info schema; no obvious structural issues found from spot-check.
openapi/components/schemas/common/BrlBeneficiary.yaml Auto-synced BRL beneficiary schema update; no obvious structural issues found from spot-check.
openapi/components/schemas/common/DkkAccountInfo.yaml Auto-synced DKK account info schema update; no obvious structural issues found from spot-check.
openapi/components/schemas/common/DkkBeneficiary.yaml Auto-synced DKK beneficiary schema update; no obvious structural issues found from spot-check.
openapi/components/schemas/common/GbpBeneficiary.yaml Auto-synced GBP beneficiary schema update; no obvious structural issues found from spot-check.
openapi/components/schemas/common/HkdAccountInfo.yaml Auto-synced HKD account info schema update; no obvious structural issues found from spot-check.
openapi/components/schemas/common/HkdBeneficiary.yaml Auto-synced HKD beneficiary schema update; no obvious structural issues found from spot-check.
openapi/components/schemas/common/IdrAccountInfo.yaml Auto-synced IDR account info schema update; no obvious structural issues found from spot-check.
openapi/components/schemas/common/IdrBeneficiary.yaml Auto-synced IDR beneficiary schema update; no obvious structural issues found from spot-check.
openapi/components/schemas/common/InrAccountInfo.yaml Auto-synced INR account info schema update; no obvious structural issues found from spot-check.
openapi/components/schemas/common/InrBeneficiary.yaml Auto-synced INR beneficiary schema update; no obvious structural issues found from spot-check.
openapi/components/schemas/common/MxnAccountInfo.yaml Auto-synced MXN account info schema update; no obvious structural issues found from spot-check.
openapi/components/schemas/common/MxnBeneficiary.yaml Auto-synced MXN beneficiary schema update; no obvious structural issues found from spot-check.
openapi/components/schemas/common/MyrAccountInfo.yaml Auto-synced MYR account info schema; no obvious structural issues found during spot-check.
openapi/components/schemas/common/MyrBeneficiary.yaml Auto-synced MYR beneficiary schema; no obvious structural issues found during spot-check.
openapi/components/schemas/common/PhpBeneficiary.yaml Auto-synced PHP beneficiary schema; no obvious structural issues found during spot-check.
openapi/components/schemas/common/SgdBeneficiary.yaml Auto-synced SGD beneficiary schema; no obvious structural issues found during spot-check.
openapi/components/schemas/common/ThbAccountInfo.yaml Auto-synced THB account info schema; no obvious structural issues found during spot-check.
openapi/components/schemas/common/ThbBeneficiary.yaml Auto-synced THB beneficiary schema; no obvious structural issues found during spot-check.
openapi/components/schemas/common/UsdAccountInfo.yaml Auto-synced USD account info schema; no obvious structural issues found during spot-check.
openapi/components/schemas/common/UsdBeneficiary.yaml Auto-synced USD beneficiary schema; no obvious structural issues found during spot-check.
openapi/components/schemas/common/VndAccountInfo.yaml Auto-synced VND account info schema; no obvious structural issues found during spot-check.
openapi/components/schemas/common/VndBeneficiary.yaml Auto-synced VND beneficiary schema; no obvious structural issues found during spot-check.
openapi/components/schemas/external_accounts/BrlAccountInfo.yaml External BRL account schema updated to new allOf composition; verify discriminator accountType compatibility with ExternalAccountInfoOneOf.
openapi/components/schemas/external_accounts/CadAccountInfo.yaml External CAD account schema updated; ensure it remains reachable via discriminator mapping and that required fields are preserved in composed common schema.
openapi/components/schemas/external_accounts/ClabeAccountInfo.yaml New simplified CLABE account schema references BaseExternalAccountInfo + common ClabeAccountInfo; may omit beneficiary requirements present in *ExternalAccountInfo variants.
openapi/components/schemas/external_accounts/DkkAccountInfo.yaml External DKK account schema updated; ensure discriminator mapping and composition align with prior ExternalAccountInfo variant behavior.
openapi/components/schemas/external_accounts/GbpAccountInfo.yaml External GBP account schema updated; relies on common/GbpAccountInfo which now lacks accountType and validation patterns.
openapi/components/schemas/external_accounts/HkdAccountInfo.yaml External HKD account schema updated; ensure discriminator mapping and composition align with prior behavior.
openapi/components/schemas/external_accounts/IbanAccountInfo.yaml External IBAN account schema updated; ensure discriminator mapping doesn’t conflict with legacy IBAN key and that composed schema still enforces required IBAN fields.
openapi/components/schemas/external_accounts/IdrAccountInfo.yaml External IDR account schema updated; ensure discriminator mapping and composition align with prior behavior.
openapi/components/schemas/external_accounts/InrAccountInfo.yaml External INR account schema updated; ensure discriminator mapping and composition align with prior behavior.
openapi/components/schemas/external_accounts/MxnAccountInfo.yaml External MXN account schema updated; ensure discriminator mapping and composition align with prior behavior.
openapi/components/schemas/external_accounts/MyrAccountInfo.yaml External MYR account schema updated; ensure discriminator mapping and composition align with prior behavior.
openapi/components/schemas/external_accounts/NgnAccountInfo.yaml External NGN account schema updated; ensure discriminator mapping and composition align with prior behavior.
openapi/components/schemas/external_accounts/PhpAccountInfo.yaml External PHP account schema updated; relies on common/PhpAccountInfo which now lacks accountType.
openapi/components/schemas/external_accounts/PixAccountInfo.yaml Adds PIX external account schema wrapper; in ExternalAccountInfoOneOf discriminator mapping, introduces additional PIX_ACCOUNT mapping alongside existing PIX mapping.
openapi/components/schemas/external_accounts/SgdAccountInfo.yaml Adds SGD external account schema wrapper; depends on common/SgdAccountInfo which removed SWIFT/BIC and accountType enum constraints.
openapi/components/schemas/external_accounts/ThbAccountInfo.yaml Introduces/updates THB external account schema wrapper (allOf composition). No obvious structural issues found.
openapi/components/schemas/external_accounts/UpiAccountInfo.yaml Adds UPI external account schema wrapper; in ExternalAccountInfoOneOf discriminator mapping, introduces additional UPI_ACCOUNT mapping alongside existing UPI mapping.
openapi/components/schemas/external_accounts/UsAccountInfo.yaml Introduces US account info wrapper (allOf composition). No obvious structural issues found.
openapi/components/schemas/external_accounts/UsdAccountInfo.yaml Introduces/updates USD external account schema wrapper (allOf composition). No obvious structural issues found.
openapi/components/schemas/external_accounts/VndAccountInfo.yaml Introduces/updates VND external account schema wrapper (allOf composition). No obvious structural issues found.

Sequence Diagram

sequenceDiagram
    participant Sparkcore as sparkcore (field defs)
    participant Webdev as webdev schema generator
    participant GridRepo as grid-api repo
    participant OpenAPI as OpenAPI components/schemas
    participant Client as client codegen/validators

    Sparkcore->>Webdev: Define/adjust VASP adapter fields
    Webdev->>Webdev: Generate YAML schemas per currency
    Webdev->>GridRepo: Copybara sync (PR #180)
    GridRepo->>OpenAPI: Update common/* and external_accounts/*
    Client->>OpenAPI: Codegen / validation uses updated schemas
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

47 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

Comment on lines 1 to +11
type: object
required:
- sortCode
- accountNumber
- accountType
- sortCode
- accountNumber
properties:
accountType:
type: string
enum:
- GBP_ACCOUNT
sortCode:
type: string
description: UK bank sort code (6 digits, may include hyphens)
example: '20-00-00'
pattern: '^[0-9]{2}-?[0-9]{2}-?[0-9]{2}$'
description: The sort code of the bank
accountNumber:
type: string
description: UK bank account number (8 digits)
example: '12345678'
minLength: 8
maxLength: 8
pattern: ^[0-9]{8}$
description: The account number of the bank
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed discriminator field
common/GbpAccountInfo.yaml no longer defines the accountType property (and it was removed from required). Since ExternalAccountInfoOneOf.yaml uses accountType as the discriminator property, GBP account payloads can no longer reliably validate/resolve to the correct schema variant.

This also drops the sort code/account number constraints (pattern/length), so invalid routing values will now pass schema validation.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/GbpAccountInfo.yaml
Line: 1:11

Comment:
**Removed discriminator field**
`common/GbpAccountInfo.yaml` no longer defines the `accountType` property (and it was removed from `required`). Since `ExternalAccountInfoOneOf.yaml` uses `accountType` as the discriminator property, GBP account payloads can no longer reliably validate/resolve to the correct schema variant.

This also drops the sort code/account number constraints (pattern/length), so invalid routing values will now pass schema validation.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 1 to +11
type: object
required:
- bankName
- swiftCode
- accountNumber
- accountType
- bankName
- accountNumber
properties:
accountType:
type: string
enum:
- SGD_ACCOUNT
bankName:
type: string
description: Name of the beneficiary's bank
example: DBS Bank Ltd
swiftCode:
type: string
description: SWIFT/BIC code (8 or 11 characters)
example: DBSSSGSG
minLength: 8
maxLength: 11
pattern: ^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$
description: The bank name of the bank
accountNumber:
type: string
description: Bank account number
example: '0123456789'
description: The account number of the bank
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped required routing fields
common/SgdAccountInfo.yaml removes both the accountType enum and the swiftCode field from required/properties. With ExternalAccountInfoOneOf.yaml discriminating on accountType, this breaks schema resolution for SGD accounts, and the removal of swiftCode (and its length/pattern constraints) means wire-transfer routing data for SGD accounts is no longer validated by the schema.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/SgdAccountInfo.yaml
Line: 1:11

Comment:
**Dropped required routing fields**
`common/SgdAccountInfo.yaml` removes both the `accountType` enum and the `swiftCode` field from `required`/`properties`. With `ExternalAccountInfoOneOf.yaml` discriminating on `accountType`, this breaks schema resolution for SGD accounts, and the removal of `swiftCode` (and its length/pattern constraints) means wire-transfer routing data for SGD accounts is no longer validated by the schema.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 1 to +11
type: object
required:
- bankName
- accountNumber
- accountType
- bankName
- accountNumber
properties:
accountType:
type: string
enum:
- PHP_ACCOUNT
bankName:
type: string
description: Name of the beneficiary's bank
example: BDO Unibank
description: The bank name of the bank
accountNumber:
type: string
description: Bank account number
example: '001234567890'
description: The account number of the bank
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing discriminator field
common/PhpAccountInfo.yaml removes the accountType enum property (and it was removed from required). Because ExternalAccountInfoOneOf.yaml uses accountType as the discriminator, PHP account payloads can’t be reliably validated/resolved to the intended schema variant anymore.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/PhpAccountInfo.yaml
Line: 1:11

Comment:
**Missing discriminator field**
`common/PhpAccountInfo.yaml` removes the `accountType` enum property (and it was removed from `required`). Because `ExternalAccountInfoOneOf.yaml` uses `accountType` as the discriminator, PHP account payloads can’t be reliably validated/resolved to the intended schema variant anymore.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 1 to +20
oneOf:
- title: US Account
$ref: ./UsAccountExternalAccountInfo.yaml
- title: CLABE Account
$ref: ./ClabeAccountExternalAccountInfo.yaml
- title: PIX Account
$ref: ./PixAccountExternalAccountInfo.yaml
- title: IBAN Account
$ref: ./IbanAccountExternalAccountInfo.yaml
- title: UPI Account
$ref: ./UpiAccountExternalAccountInfo.yaml
- title: NGN Account
$ref: ./NgnAccountExternalAccountInfo.yaml
- title: CAD Account
$ref: ./CadAccountExternalAccountInfo.yaml
- title: GBP Account
$ref: ./GbpAccountExternalAccountInfo.yaml
- title: PHP Account
$ref: ./PhpAccountExternalAccountInfo.yaml
- title: SGD Account
$ref: ./SgdAccountExternalAccountInfo.yaml
- title: Spark Wallet
$ref: ./SparkWalletExternalAccountInfo.yaml
- title: Lightning
$ref: ./LightningExternalAccountInfo.yaml
- title: Solana Wallet
$ref: ./SolanaWalletExternalAccountInfo.yaml
- title: Tron Wallet
$ref: ./TronWalletExternalAccountInfo.yaml
- title: Polygon Wallet
$ref: ./PolygonWalletExternalAccountInfo.yaml
- title: Base Wallet
$ref: ./BaseWalletExternalAccountInfo.yaml
- title: US Account
$ref: ./UsAccountExternalAccountInfo.yaml
- title: CLABE Account
$ref: ./ClabeAccountExternalAccountInfo.yaml
- title: PIX Account
$ref: ./PixAccountExternalAccountInfo.yaml
- title: IBAN Account
$ref: ./IbanAccountExternalAccountInfo.yaml
- title: UPI Account
$ref: ./UpiAccountExternalAccountInfo.yaml
- title: NGN Account
$ref: ./NgnAccountExternalAccountInfo.yaml
- title: CAD Account
$ref: ./CadAccountExternalAccountInfo.yaml
- title: GBP Account
$ref: ./GbpAccountExternalAccountInfo.yaml
- title: PHP Account
$ref: ./PhpAccountExternalAccountInfo.yaml
- title: SGD Account
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicting discriminator values
ExternalAccountInfoOneOf.yaml now includes new *_ACCOUNT mappings (e.g. CLABE_ACCOUNT, PIX_ACCOUNT, IBAN_ACCOUNT, UPI_ACCOUNT) while keeping the old values (CLABE, PIX, IBAN, UPI) mapped to the existing *ExternalAccountInfo.yaml schemas.

If clients send different accountType values for the same conceptual account type, they’ll validate against different schemas (some include beneficiary via *ExternalAccountInfo.yaml, while the new *AccountInfo.yaml wrappers do not). This creates inconsistent API validation/codegen behavior and should be normalized to a single discriminator value per variant.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml
Line: 1:20

Comment:
**Conflicting discriminator values**
`ExternalAccountInfoOneOf.yaml` now includes new `*_ACCOUNT` mappings (e.g. `CLABE_ACCOUNT`, `PIX_ACCOUNT`, `IBAN_ACCOUNT`, `UPI_ACCOUNT`) while keeping the old values (`CLABE`, `PIX`, `IBAN`, `UPI`) mapped to the existing `*ExternalAccountInfo.yaml` schemas.

If clients send different `accountType` values for the same conceptual account type, they’ll validate against different schemas (some include `beneficiary` via `*ExternalAccountInfo.yaml`, while the new `*AccountInfo.yaml` wrappers do not). This creates inconsistent API validation/codegen behavior and should be normalized to a single discriminator value per variant.

How can I resolve this? If you propose a fix, please make it concise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant